/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.gu.derp.beans.feeds;

import edu.gu.derp.model.Account;
import edu.gu.derp.model.Database;
import edu.gu.derp.model.Feed;
import edu.gu.derp.model.IController;
import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author jensc
 */
@ManagedBean(name="FeedsBackingBean")
@RequestScoped
public class FeedsBackingBean implements Serializable{
    
    private IController controller = Database.getController();
    private String feedUrl;

    public String getFeedUrl() {
        return feedUrl;
    }

    public void setFeedUrl(String feedUrl) {
        this.feedUrl = feedUrl;
    }
    
    public List<Feed> getFeeds() {
        Account account = (Account) FacesContext.getCurrentInstance()
                .getExternalContext().getSessionMap().get("account");
        return controller.getFeeds(account);
    }
    
}
